package com.itheima.case2.dao;

import com.itheima.case2.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {
    @Select("SELECT * FROM user WHERE username=#{username} AND password=#{password}")
    User login(@Param("username") String username, @Param("password")String password);
    @Select("select count(*) from t_user ")
    int queryUsersCount();
    //@Select("select * from t_user limit #{startIndex},#{pageSize}")
    List<User> findAllUsersByPage(@Param("startIndex")int startIndex, @Param("pageSize")int pageSize);
@Update({"update t_user set username=#{username},email=#{email},password=#{password} where id=#{id}"})
    void updataUser(User user);
}
